<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- z-index  谁的值越大谁在上面 -->
    <!-- 只有定位的盒子才会有该属性 -->
    <!-- 没有属性时后来者巨上 -->
    <style>
        .box {
            width: 200px;
            height: 200px;
            position: absolute;
            top: 0;
            left: 0;
        }

        .first {
            background-color: aquamarine;
        }

        .second {
            background-color: red;
            top: 50px;
            left: 50px;
            z-index: 1;
        }

        .thirst {
            background-color: black;
            top: 100px;
            left: 100px;
        }
    </style>
</head>

<body>
    <div class="box first"></div>
    <div class="box second"></div>
    <div class="box thirst"></div>
</body>

</html>